package start;

import enumUtil.TimeEnum;
import interfave.ConvertInterface;
import service.TimeConvert;

import javax.xml.crypto.Data;
import java.text.DateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;

/**
 * @Classname Start
 * @Description TODO
 * @Date 2021/12/1 16:39
 * @Created by silence(dxs)
 */
public class Start {
    public static void main(String[] args) {
        Date date = new Date();
        // lambda 写法
        Long time = new TimeConvert().convertToStamp((item)->{
            return item.getTime();
                }
        , date, TimeEnum.SECOND);
        // :: 写法
        Long time1 = new TimeConvert().convertToStamp(new Start()::getTimeStamp
                , date, TimeEnum.SECOND);
        System.out.println("lambda==》"+time);
        System.out.println("::==》"+time1);



    }
    public Long getTimeStamp(Date data){
        return data.getTime();
    }
}
